<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第七题</title>
</head>

<body>
    <script>
        let arr = [0, 0, 0, 0, 6, 45, 9, 21, 0, 0, 0, 3, 53, 583, 58, 62, 6, 2, 6, 7]
        let arr1 = []
        let arr2 = []
        let j = 0
        let k = 0
        for (let i = 0; i < arr.length; i++) {
            if (arr[i] === 0) {
                arr2[j] = arr[i]
                j++
            } else {
                arr1[k] = arr[i]
                k++
            }
        }
        console.log(arr1)
        console.log(arr2)
    </script>
</body>

</html>